﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NewsClassifierFreshnessMeasurement.QueryExtractor;
using NewsClassifierFreshnessMeasurement.Model;
using AutoExtractQueryToXMLFile;
using NewsClassifierFreshnessMeasurement.Shared;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            QueryExtractorFactory factory = new QueryExtractorFactory();

            ProduceFile pro = new ProduceFile();

            string tmpConfigPath = "D:\\HighLight.xml";
            List<string> listConfigPath = new List<string>();
            listConfigPath.Add(tmpConfigPath);

            Console.WriteLine("\nAppendix:");
            string tmpAppendix = "_Poll1";
            List<string> listAppendix = new List<string>();
            listAppendix.Add(tmpAppendix);
            List<KeyValuePair<string, Configuration>> l = pro.CreateListAppendixConfig(listConfigPath, listAppendix);

            IQueryExtractor query = factory.CreateQueryExtractor("_Poll1", l.First().Value);
            List<News> listNews = pro.GetNewsFromDatabase("select top 20 * from newsitemlist where sourceid in (select id from rss where groupid=2)");
            foreach (News news in listNews)
            {
                List<NewsQuery> listQuery = query.Extract(news);
            }

        }
    }
}
